﻿using System.Collections;
using System.Collections.Generic;
using System.Threading;

namespace CoreLibrary.Collection {

    public class ReadWriteHashSet<T> : ISet<T> {

        private readonly HashSet<T> _hashSet = new HashSet<T>(); 
        private readonly ReaderWriterLockSlim _readerWriter = new ReaderWriterLockSlim();

        public int Count {
            get {
                _readerWriter.EnterReadLock();
                try {
                    return _hashSet.Count;
                }
                finally {
                    _readerWriter.ExitReadLock();       
                }
            }
        }

        public bool IsReadOnly {
            get {
                return false;
            }
        }

        public IEnumerator<T> GetEnumerator() {
            throw new System.NotImplementedException();
        }

        IEnumerator IEnumerable.GetEnumerator() {
            return GetEnumerator();
        }

        void ICollection<T>.Add(T item) {
            throw new System.NotImplementedException();
        }

        public void UnionWith(IEnumerable<T> other) {
            throw new System.NotImplementedException();
        }

        public void IntersectWith(IEnumerable<T> other) {
            throw new System.NotImplementedException();
        }

        public void ExceptWith(IEnumerable<T> other) {
            throw new System.NotImplementedException();
        }

        public void SymmetricExceptWith(IEnumerable<T> other) {
            throw new System.NotImplementedException();
        }

        public bool IsSubsetOf(IEnumerable<T> other) {
            throw new System.NotImplementedException();
        }

        public bool IsSupersetOf(IEnumerable<T> other) {
            throw new System.NotImplementedException();
        }

        public bool IsProperSupersetOf(IEnumerable<T> other) {
            throw new System.NotImplementedException();
        }

        public bool IsProperSubsetOf(IEnumerable<T> other) {
            throw new System.NotImplementedException();
        }

        public bool Overlaps(IEnumerable<T> other) {
            throw new System.NotImplementedException();
        }

        public bool SetEquals(IEnumerable<T> other) {
            throw new System.NotImplementedException();
        }

        public bool Add(T item) {
            throw new System.NotImplementedException();
        }

        public void Clear() {
            throw new System.NotImplementedException();
        }

        public bool Contains(T item) {
            throw new System.NotImplementedException();
        }

        public void CopyTo(T[] array, int arrayIndex) {
            throw new System.NotImplementedException();
        }

        public bool Remove(T item) {
            throw new System.NotImplementedException();
        }

        
    }

}